<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
<style>
    .box1 {
        width: 500px;
        height: 500px;
        border: 5px solid black;
        transform-style: preserve-3d;/*3d舞台*/
        position: relative;
        perspective: 1200px;
    }
    .center{
        position:absolute;
        width: 200px;
        height: 200px;
        background: red;
        left: 50%;  
        top: 50%;
        margin-left: -100px;
        margin-top: -100px;
        transform: translateZ(300PX);
    }
</style>
</head>
<body>
    <div class="box1">
        <div class="center">

        </div>
    </div>
</body>
</html>